package com.github.codemperor.api.base;

/**
 * @author codemperor
 * @description 通用的返回码
 */
public enum BaseCodeEnum implements IBaseCodeEnum {
    /**
     * 一切正常
     */
    OK(0, "ok"),
    LOGIN(403, "需要重新登陆"),

    /**
     * 请求异常,也可以使用HttpStatus通用枚举
     */
    BAD_REQUEST(100, "Please input valid params"),
    FORBIDDEN(101, "You have no permission"),
    NOT_FOUND(102, "Request does not exist"),
    INTERNAL_SERVER_ERROR(103, "Server error"),
    IO_SERVER_ERROR(104, "IO发生错误"),
    TOKEN_NULL(105, "Token is not exist"),
    TOKEN_EXPIRED(106, "Token expired"),
    TOKEN_ERROR(107, "token error"),
    TOKEN_NO_PERMISSION(108, "You have no permission"),
    SIGN_GATEWAY_NOT_FOUND(109, "网关签名找不到"),
    SIGN_GATEWAY_ERROR(110, "网关签名解析错误"),
    SIGN_SERVICE_NOT_FOUND(111, "业务服务签名找不到"),
    SIGN_SERVICE_ERROR(112, "业务服务签名解析错误"),
    INQUIRY_PRARMETER_INVALID(113, "inquiry parameter  invalid"),
    INQUIRY_NO_FOUND(114, "inquiry no found"),

    ;

    private Integer code;
    private String message;

    BaseCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
